//
//  AvtisendTableViewCell.m
//  电影er
//
//  Created by dllo on 16/6/25.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "AvtisendTableViewCell.h"
#import "AvtivityModel.h"
@interface AvtisendTableViewCell()


@property(nonatomic,retain)UIImageView *imageview;
@property(nonatomic,retain)UIImageView *imageview1;
@property(nonatomic,retain)UIImageView *imageview2;
@property(nonatomic,retain)UIImageView *imageview3;
@property(nonatomic,retain)UIImageView *poview;

@property(nonatomic,retain)UILabel *label1;
@property(nonatomic,retain)UILabel *label2;
@property(nonatomic,retain)UILabel *label3;
@property(nonatomic,retain)UILabel *label4;
@property(nonatomic,retain)UILabel *label5;
@property(nonatomic,retain)UILabel *label6;
@property(nonatomic,retain)UILabel *label7;
@property (nonatomic,retain)UILabel *titleLabel;


@end
@implementation AvtisendTableViewCell

-(void)dealloc{
    [_imageview release];
    [_imageview1 release];
    [_imageview2 release];
    [_imageview3 release];
    [_label1 release];
    [_label2 release];
    [_label3 release];
    [_label4 release];
    [_label5 release];
    [_label6 release];
    [_label7 release];
    [_titleLabel release];
    [super dealloc];
    
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        self.imageview =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"icon_date_blue@2x.png" ]];
        [self.contentView addSubview:_imageview];
        [_imageview release];
        
        self.imageview1 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"icon_sponsor_blue@2x.png"]];
        [self.contentView addSubview:_imageview1];
        [_imageview1 release];
        
        self.imageview2 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"icon_catalog_blue@2x.png"]];
        [self.contentView addSubview:_imageview2];
        [_imageview2 release];
        
        self.imageview3 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"icon_spot_blue@2x.png"]];
        [self.contentView addSubview:_imageview3];
        [_imageview3 release];
        
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.titleLabel];
        [_titleLabel release];
        
        UILabel *huolabel= [[UILabel alloc]init];
        huolabel.text = @"活动介绍";
        huolabel.font = [UIFont boldSystemFontOfSize:30];
        huolabel.frame = CGRectMake(10, 250, 200, 40);
        [self.contentView addSubview:huolabel];
        [huolabel release];
        
//        UILabel *zhanlabel = [[UILabel alloc]init];
//        zhanlabel.text = @"展期";
//        zhanlabel.font = [UIFont systemFontOfSize: 20];
//        zhanlabel.frame  = CGRectMake(10, 330, 40, 30);
//        [self.contentView addSubview:zhanlabel];
//        [zhanlabel release];
//        
//        UILabel *dilabel  = [[UILabel alloc]init];
//        dilabel.text = @"地点";
//        dilabel.font = [UIFont systemFontOfSize:20];
//        dilabel.frame = CGRectMake(10, 350, 40, 30);
//        [self.contentView addSubview: dilabel];
//        [dilabel release];
//        
//        UILabel *zhulabel  = [[UILabel alloc]init];
//        zhulabel.text = @"主办";
//        zhulabel.font = [UIFont systemFontOfSize:20];
//        zhulabel.frame = CGRectMake(10, 380, 40, 30);
//        [self.contentView addSubview: zhulabel];
//        [zhulabel release];
//        
//        UILabel *menlabel  = [[UILabel alloc]init];
//        menlabel.text = @"门票";
//        menlabel.font = [UIFont systemFontOfSize:20];
//        menlabel.frame = CGRectMake(10, 410, 40, 30);
//        [self.contentView addSubview: menlabel];
//        [menlabel release];
//        
//        
//        UILabel *xianglabel  = [[UILabel alloc]init];
//        xianglabel.text = @"展览详情";
//        xianglabel.font = [UIFont systemFontOfSize:20];
//        xianglabel.frame = CGRectMake(10, 440, 40, 30);
//        [self.contentView addSubview: xianglabel];
//        [xianglabel release];
        
//        UILabel *tilabel  = [[UILabel alloc]init];
//        tilabel.text = @"[提示]";
//        tilabel.font = [UIFont systemFontOfSize:20];
//        tilabel.frame = CGRectMake(10, 350, 40, 30);
//        [self.contentView addSubview: tilabel];
//        [tilabel release];
//        
//        
//        
        self.label1 = [[UILabel alloc]init];
        [self.contentView addSubview:_label1];
        [_label1 release];
        
        self.label2 = [[UILabel alloc]init];
        [self.contentView addSubview:_label2];
        [_label2 release];
        
        self.label3 = [[UILabel alloc]init];
        [self.contentView addSubview:_label3];
        [_label3 release];
        
        self.label4 =[[UILabel alloc]init];
        [self.contentView addSubview:_label4];
        [_label4 release];
        
        self.label5 = [[UILabel alloc]init];
        [self.contentView addSubview:_label5];
        [_label5 release];
        
        self.label6 = [[UILabel alloc]init];
        self.label6.text = @"类型:";
        self.label6.frame = CGRectMake(170, 110, 100, 20);
        [self.contentView addSubview:_label6];
        [_label6 release];
        
        self.poview = [[UIImageView alloc]init];
        [self.contentView addSubview:_poview];
        [_poview release];
        
        
        
        
        
        
        
        
        
        
        
        
    }
    return self;
    
}
-(void)layoutSubviews{
    [super layoutSubviews ];
    self.imageview.frame =CGRectMake(150, 50, 20, 20);
    self.imageview1.frame = CGRectMake(150, 80, 20, 20);
    self.imageview2.frame = CGRectMake(150, 110, 20, 20);
    self.imageview3.frame = CGRectMake(150, 140, 20, 20);
    self.titleLabel.frame = CGRectMake(10, 10, 500, 50);
    self.titleLabel.font = [UIFont systemFontOfSize:20];
    self.titleLabel.numberOfLines =0;
    self.label1.frame = CGRectMake(10, 293, self.contentView.frame.size.width-20, 600);
    self.label1.numberOfLines = 0;
//    self.label3.frame = CGRectMake(180, 50, 100, 20);
    self.label2.frame = CGRectMake(180, 80, 100, 20);
    self.label4.frame = CGRectMake(210, 110, 100, 20);
    self.label5.frame = CGRectMake(180, 140, 200, 70);
    self.label5.numberOfLines = 0;
    self.poview.frame = CGRectMake(10, 50, 130, 200);
}
-(void)setAvmodel:(AvtivityModel *)avmodel{
    if (_avmodel != avmodel) {
        [_avmodel release];
        _avmodel = [avmodel retain];
        
    }
    self.titleLabel.text = avmodel.title;//标题
    self.label1.text = avmodel.content;//活动介绍
    self.label2.text = avmodel.loc_name;//单位
    self.label4.text = avmodel.category_name;//类型
    self.label5.text = avmodel.address;//地点
    NSURL *url = [NSURL URLWithString:avmodel.image_lmobile];
    NSData *data = [NSData dataWithContentsOfURL:url];
    self.poview.image = [UIImage imageWithData:data];
    
    
    
    
}




@end
